﻿using System.Configuration;

namespace AnOtherBlog.Core.Providers
{
	/// <summary>
	///	Sección de configuración para acceder al web.config
	/// </summary>
	public class DataProviderSection : ConfigurationSection
	{

		/// <summary>
		/// Colección de proveedores registrados en el web.config
		/// </summary>
		[ConfigurationProperty("providers")]
		public ProviderSettingsCollection Providers
		{
			get { return (ProviderSettingsCollection)base["providers"]; }
		}

		/// <summary>
		/// Proveedor por defecto
		/// </summary>
		[StringValidator(MinLength = 1)]
		[ConfigurationProperty("defaultProvider", DefaultValue = "SQLDataProvider")]
		public string DefaultProvider
		{
			get
			{
				return (string)base["defaultProvider"];
			}
			set
			{
				base["defaultProvider"] = value;
			}
		}
	}
}
